/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ahmed
 */
@Entity
@Table(name = "PRIX_VENTE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PrixVente.findAll", query = "SELECT p FROM PrixVente p"),
    @NamedQuery(name = "PrixVente.findById", query = "SELECT p FROM PrixVente p WHERE p.id = :id"),
    @NamedQuery(name = "PrixVente.findByIdItem", query = "SELECT p FROM PrixVente p WHERE p.idItem = :idItem"),
    @NamedQuery(name = "PrixVente.findByValeur", query = "SELECT p FROM PrixVente p WHERE p.valeur = :valeur"),
    @NamedQuery(name = "PrixVente.findByDate", query = "SELECT p FROM PrixVente p WHERE p.date = :date"),
    @NamedQuery(name = "PrixVente.findByPromotionel", query = "SELECT p FROM PrixVente p WHERE p.promotionel = :promotionel")})
public class PrixVente implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    @GeneratedValue(strategy= GenerationType.AUTO)
    private BigDecimal id;
    @Column(name = "ID_ITEM")
    private BigInteger idItem;
    @Column(name = "VALEUR")
    private BigDecimal valeur;
    @Basic(optional = false)
    @Column(name = "DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date date;
    @Basic(optional = false)
    @Column(name = "PROMOTIONEL")
    private BigInteger promotionel;

    public PrixVente() {
    }

    public PrixVente(BigDecimal id) {
        this.id = id;
    }

    public PrixVente(BigDecimal id, Date date, BigInteger promotionel) {
        this.id = id;
        this.date = date;
        this.promotionel = promotionel;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public BigInteger getIdItem() {
        return idItem;
    }

    public void setIdItem(BigInteger idItem) {
        this.idItem = idItem;
    }

    public BigDecimal getValeur() {
        return valeur;
    }

    public void setValeur(BigDecimal valeur) {
        this.valeur = valeur;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public BigInteger getPromotionel() {
        return promotionel;
    }

    public void setPromotionel(BigInteger promotionel) {
        this.promotionel = promotionel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PrixVente)) {
            return false;
        }
        PrixVente other = (PrixVente) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MODEL.PrixVente[ id=" + id + " ]";
    }
    
}
